﻿using Microsoft.Extensions.Options;

namespace EventBus.RabbitMQ
{
    /// <summary>
    /// RabbitMQ配置
    /// </summary>
    public class RabbitMQOptions : IOptions<RabbitMQOptions>
    {
        /// <summary>
        /// 默认密码
        /// </summary>
        /// <remarks></remarks>
        public const string DefaultPass = "guest";

        /// <summary>
        /// 默认用户名
        /// </summary>
        /// <remarks></remarks>
        public const string DefaultUser = "guest";

        /// <summary>
        /// 默认主机
        /// </summary>
        /// <remarks></remarks>
        public const string DefaultVHost = "/";

        /// <summary>
        /// 默认主机
        /// </summary>
        /// <remarks></remarks>
        public const int DefaultPort = 5672;

        /// <summary>
        /// 默认交换机
        /// </summary>
        public const string DefaultExchangeName = "exchangeName.default.router";

        /// <summary>
        /// 路由类型
        /// </summary>
        public const string ExchangeType = "topic";

        /// <summary>
        /// 主机名
        /// </summary>
        public string HostName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 端口
        /// </summary>
        public string VirtualHost { get; set; } = DefaultVHost;

        /// <summary>
        /// 交换机
        /// </summary>
        public string ExchangeName { get; set; } = DefaultExchangeName;

        /// <summary>
        /// 端口
        /// </summary>
        public int Port { get; set; } = DefaultPort;

        public RabbitMQOptions Value => this;
    }
}
